<template>
    <el-dialog
        v-model="visible"
        title="日志"
        center
        :close-on-click-modal="false"
        @close="close"
        destroy-on-close
        :width="800"
    >
        <section>
            <page-wrapper @get-data="getData" ref="pageRef">
                <template v-slot:default="props">
                    <vxe-table
                        class="mytable-scrollbar"
                        ref="tableRef"
                        :loading="props.loading"
                        :data="props.tableData.records"
                        :max-height="300"
                        highlight-hover-row
                        align="center"
                        round
                        stripe
                        border
                    >
                        <vxe-column type="seq" width="40"></vxe-column>
                        <vxe-column field="msg" title="日志内容"/>
                        <vxe-column field="createTime" title="操作时间" />
                        <vxe-column field="createBy" title="操作人" />
                    </vxe-table>
                </template>
            </page-wrapper>
        </section>
    </el-dialog>
</template>

<script>
    export default {
        name: 'dailyRecord'
    }
</script>
<script setup>
    import { reactive, onMounted, toRaw, ref, createVNode } from 'vue'
    import PageWrapper from '@components/PageWrapper.vue'
    import { common, service } from '@utils';
    const state = reactive({
        orderId:''
    })
    const pageRef = ref();
    const tableRef = ref();
    const visible = ref(false)
    const open = (orderId) => {
        state.orderId = orderId
        visible.value = true
    }
    const close = () => {
        visible.value = false
    }
    const getData = async ({ pageNum, pageSize }, cb) => {
        console.log(state.orderId)
        const res = await service.bfqz.getLogByOrderId(pageNum, pageSize,state.orderId)
        cb(res)
        setTimeout(() => {
            tableRef.value.scrollTo(0, 0)
        }, 0)
    }
    //把方法暴露给父组件
    defineExpose({
        open
    })
</script>
<style scoped lang="less"></style>
